{{extend 'layout.html'}}

<!-- BEGIN Timeline Embed -->
{{=DIV(_id="timeline-embed")}}
<script type="text/javascript">
/* {{
# response.files.append(URL(c='static', f='timeline/compiled/css/timeline.css'))
# Does not work unless = is used before the command (which generates improper html).
}} */
/*
var timeline_config = {
    width:  "100%",
    height: "100%",
    source: '{{=URL(c="static", f="timeline/examples/example_kitchensink.json")}}',
    // start_at_end: true,                   //OPTIONAL
    // hash_bookmark: true,                  //OPTIONAL
    css:    '{{=URL(c="static", f="timeline/compiled/css/timeline.css")}}',     //OPTIONAL
    js:     '{{=URL(c="static", f="timeline/compiled/js/timeline.js")}}'    //OPTIONAL
};
jQuery(function(){
                  jQuery.getScript("{{=URL(c='static', f='timeline/compiled/js/timeline.js')}}");
                  jQuery.getScript("{{=URL(c='static', f='timeline/compiled/js/timeline-embed.js')}}");
                 });
*/
</script>

{{ tbody = TBODY() }}

{{ for number, row in enumerate(cells):}}
  {{ row_class = "odd" }}
  {{ if number % 2 == 0:}}
    {{ row_class = "even" }}
  {{ pass }}
  {{ tr = TR(_class=row_class) }}
  {{ for cell in row: }}
    {{ if cell is None: }}
      {{ tr.append(TD(_class="empty")) }}
    {{ elif cell != 0: }}
      {{ event = db.event[cell] }}
      {{ colspan = event_spans(event) }}
      {{ tr.append(TD(event.title, _class="event", _colspan=colspan)) }}
    {{ pass }}
  {{ pass}}
  {{ tbody.append(tr) }}
{{ pass }}

{{ =TABLE(tbody) }}